import 'package:flutter/cupertino.dart';
import 'package:xlp_github_app_flutter/page/MainPage.dart';

import '../../widget/never_overscroll_indicator.dart';

/// 导航栏
class NavigatorUtils {

  ///主页
  static goMain(BuildContext context) {
    Navigator.pushReplacementNamed(context, MainPage.sName);
  }

  ///Page页面的容器，做一次通用自定义
  static Widget pageContainer(widget, BuildContext context) {
    return MediaQuery(

      ///不受系统字体缩放影响
        data: MediaQuery.of(context).copyWith(textScaler: TextScaler.noScaling),
        child: NeverOverScrollIndicator(
          needOverload: false,
          child: widget,
        ));
  }
}